import { Outlet } from "react-router-dom"
import { request } from "@/util"
import { useEffect, useState } from "react"
import { Button } from "antd"

const Home = () => {
  const [users, setUsers] = useState([])
  const handleClick = () => {
    request.post("/user/list", {}).then(res => {
      setUsers(res.records)
    })
  }
  useEffect(() => {}, [])
  return (
    <div>
      <Button onClick={handleClick}>首页</Button>
      {users.map(item => (
        <div key={item.id}>{item.username}</div>
      ))}
      <Outlet />
    </div>
  )
}
export default Home
